import instance from "@/utils/requestUtils";


let menuApi = {
    //分页条件查询
    searchPage(searchForm) {
        return instance.get('menu', {params: searchForm})
    },

    findById(id) {
        return instance.get(`menu/${id}`)
    },

    addMenu(menu) {
        return instance.post(`menu`, menu);
    },
    updateMenu(menu) {
        return instance.put(`menu`, menu);
    },
    deleteById(id) {
        return instance.delete(`menu/${id}`)
    },
    batchDelete(ids) {
        return instance.delete(`menu/batch/${ids}`)
    },

    getParentTree() {
        return instance.get(`menu/parentTree`);
    }

}

export default menuApi;
